home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.1 KB | 141 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWFcsSet.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWFCSSET_H
- #define FWFCSSET_H
-
- #ifndef FWREFCNT_H
- #include "FWRefCnt.h"
- #endif
-
- #ifndef SOM_ODFocusSetIterator_xh
- #include <FocusItr.xh>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class FW_CLASS_ATTR ODFocusSet;
- class FW_CLASS_ATTR ODSession;
- class FW_CLASS_ATTR FW_CFocusSetRep;
-
- //========================================================================================
- // class FW_CFocusSet
- //========================================================================================
-
- class FW_CFocusSet FW_AUTO_DESTRUCT_OBJECT
- {
- //----------------------------------------------------------------------------------------
- // Constructor(s)/Destructor
- //
- public:
- FW_CFocusSet(Environment* ev, ODSession* session);
- FW_CFocusSet(const FW_CFocusSet& focusSet);
-
- virtual ~FW_CFocusSet();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void Add(Environment* ev, ODTypeToken focus);
- void Remove(Environment* ev, ODTypeToken focus);
-
- FW_Boolean Contains(Environment* ev, ODTypeToken focus) const;
- unsigned short Count(Environment* ev) const
- {return fFociCount;}
-
- //----------------------------------------------------------------------------------------
- // For Internal use
- //
- public:
- void RelinquishFocusSet(Environment* ev, ODFrame* frame) const;
- FW_Boolean RequestFocusSet(Environment* ev, ODFrame* frame) const;
- ODFocusSetIterator* CreateFocusSetIterator(Environment* ev) const;
-
- void CopyIfShared(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // operators
- //
- public:
- FW_CFocusSet& operator=(const FW_CFocusSet& focusSet);
-
- //----------------------------------------------------------------------------------------
- // Data Member
- //
- private:
- unsigned short fFociCount;
- ODSession* fSession;
- FW_CFocusSetRep* fFocusSetRep;
- };
-
- //========================================================================================
- // CLASS FW_CCountedPtrRep
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CFocusSetRep : public FW_MRefCount
- {
- friend class FW_CLASS_ATTR FW_CFocusSet;
-
- //----------------------------------------------------------------------------------------
- // Constructor(s)/Destructor
- //
- public:
- FW_CFocusSetRep(Environment* ev, ODSession* session);
- virtual ~FW_CFocusSetRep();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- protected:
- ODFocusSet* fODFocusSet;
- };
-
- //========================================================================================
- // class FW_CFocusSetIterator
- //========================================================================================
-
- class FW_CFocusSetIterator FW_AUTO_DESTRUCT_OBJECT
- {
- //----------------------------------------------------------------------------------------
- // Constructor(s)/Destructor
- //
- public:
- FW_CFocusSetIterator(Environment* ev, const FW_CFocusSet& focusSet);
- ~FW_CFocusSetIterator();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- ODTypeToken First(Environment* ev)
- {return fIterator->First(ev);}
- ODTypeToken Next(Environment* ev)
- {return fIterator->Next(ev);}
- FW_Boolean IsNotComplete(Environment* ev)
- {return fIterator->IsNotComplete(ev);}
-
- //----------------------------------------------------------------------------------------
- // Data Member
- //
- private:
- ODFocusSetIterator* fIterator;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif